<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	String phone = (String)request.getSession().getAttribute("phone");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
		<title>非物质文化遗产</title>
		<link rel="icon" href="<%=basePath %>views/gj/img/favicon.png" type="image/x-icon">
		<link rel="stylesheet" href="<%=basePath %>views/lcx/css/index.css">
		<link rel="stylesheet" href="<%=basePath %>views/lcx/layui-v2.5.5/layui/css/layui.css" />
		<link rel="stylesheet" href="<%=basePath %>views/lcx/layui-v2.5.5/layui/css/modules/layer/default/layer.css" />
		<script src="<%=basePath %>views/lcx/layui-v2.5.5/layui/layui.js"></script>
		<script type="text/javascript" src="<%=basePath %>views/lcx/js/jquery-3.3.1.min.js" ></script>
		<script type="text/javascript" src="<%=basePath %>views/lcx/js/index.js" ></script>
		<script src="${basePath}views/gj/js/begin.js"></script>
		
	</head>
	<body onload="startTime()">
		<input type="hidden" id="indexMsg" value="${msg }"/>
		<div style="width: 1000px;margin: 0 auto;">
			<div class="hhhh">
				<div class="header">
					<div style="display: inline-block;">
						<img width="587px" src="${basePath }views/lcx/img/logo.png" class="logo"/>
					</div>
					<div style="display: inline-block; vertical-align: top; height: 130px; margin-top: 30px;">
						<font>
							<span id="nowDateTimeSpan"></span>
						</font> 
						<div style="width: 240px;">
							<iframe frameborder="0" allowtransparency="true" src="http://i.tianqi.com/index.php?c=code&id=36&icon=5&num=1"></iframe>
						</div>
					</div>
					<div style="display: inline-block; ">
						<c:choose>
							<c:when test="${user==null }">
								<div style="display: inline-block; margin: 0px 20px; position: relative;" id="flag1">
									<a style="margin: 0px 5px;" href="${basePath}views/user/login.jsp" class="login">登录</a>
									<a style="margin: 0px 5px;" href="${basePath}views/user/register1.jsp" class="register">注册</a>
								</div>
							</c:when>
							<c:otherwise>
								<div style="display: inline-block; padding-left: 20px; padding-top: 20px;" id="flag2">
									<a title="个人中心" href="<%=basePath %>personInit" style="margin: 0; padding: 0;">
										<c:choose>
											<c:when test="${user.head_photo==null }">
												<img width="100px" height="100px" src="<%=basePath %>views/lcx/img/2016061417302085.jpg"/>
											</c:when>
											<c:otherwise>
												<img width="100px" height="100px" src="${user.head_photo }"/>
											</c:otherwise>
										</c:choose>
									</a>
								</div> 
							</c:otherwise>
						</c:choose>
					</div>
				</div>
				<div class="Navigation">
					<ul>
						<li><a style="color: black;" href="<%=basePath %>index.do">首页</a></li>
						<li><a href="<%=basePath %>views/user/list.jsp">非遗清单</a></li>
						<li><a href="<%=basePath %>views/zcs/answerpage/main.jsp">非遗知多少</a></li>
						<li><a href="<%=basePath %>views/zcs/answerpage/moyi_succeed_.jsp">传承现状</a></li>
						<li><a href="<%=basePath %>views/jzl/compony.jsp"><span>莫遗小窝</span></a></li>
						<li><a href="<%=basePath %>luntan">论坛</a></li>
						<li><a href="<%=basePath %>views/user/maptest.jsp">非遗一览</a></li>
						<li><a href="<%=basePath %>views/user/activity.jsp">活动公告</a></li>
						<c:if test="${user.status==1 }">
							<li><a href="${basePath}sysInit">系统设置</a></li>
						</c:if>
					</ul>
				</div>
			
			</div>	
			<div class="container">
				<div id="imglunbo">
					<div class="layui-carousel" id="test1">
						<div carousel-item id="sss">
						    
						</div>
					</div>
				</div>
				<div class="container-main">
					<div class="activity-notice">
						<div class="activity-notice-article">
							<div id="activity-notice-title">活动公告</div>
							<div id="notice" class="activity-notice-message">
							</div>
							<div id="activity-notice-message"><a href="${basePath}views/user/activity.jsp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;更多 >></a></div>
						</div>
					</div>
					<div class="activity-subject">
						<div class="activity-subject-title">热门专题</div>
					</div>
					<c:forEach items="${index }" var="c">
						<div class="folk-literature">
							<div class="folk-literature-title">
								${c.title }
							</div>
							<div class="folk-literature-contain">
								<c:forEach items="${c.lists }" var="d" end="3">
									<div>
                                        <a target="_blank" href="${d.list_url}">
                                            <img src="${d.list_photo}" />
                                            <div align="center">${d.list_name}</div>
                                        </a>
									</div>
								</c:forEach>
							</div>
						</div>
					</c:forEach>
					
				</div>
			</div>
			<div id="foot" class="foot">
				<hr class="layui-bg-orange">
				<div class="copyright">
					小莫2019
				</div>
				<div class="copyright">
					All Rights Reserved 版权所有，违者必究
				</div>
				<div class="copyright">
					河南省郑州市高新区科学大道100号
				</div>
				<div class="copyright">
					联系我们 邮箱：iezljin@163.com QQ：2313954270
				</div>
				<div class="footright">
					<div class="footblock">
						<img src="<%=basePath %>views/lcx/img/weichatQRCode.jpg" />
						<div>莫遗官方微信公众号</div>
					</div>
					<div class="footblock">
						<img src="<%=basePath %>views/lcx/img/weibo.png" />
						<div>莫遗官方微博</div>
					</div>
					<div class="footblock">
						<img src="<%=basePath %>views/lcx/img/QQtalk.jpg" />
						<div>莫遗官方QQ讨论群</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(function() {
				var a=$("#indexMsg").val();
				if(a!=null&&a!=''){
					alert(a);
				}
				$.ajax({ //
					type : "get",
					url : "${basePath}indexInit", //添加操作的路径
					dataType : "JSON", //返回JSON格式的数据
					async : false,//同步传输
					success : function(data) {
						if(data==''||data==" "||data==null){
							$("#sss").append("<div><img style='width:1000px; height: 400px' src='${basePath }views/lcx/img/11.jpg' /></div>");
						}else{
							$.each(data,function(){
								$("#sss").append("<div><img style='width:1000px; height: 400px' src='"+this.url+"' /></div>");
							});
						}
					}
				});
				layui.use('carousel', function(){
				  	var carousel = layui.carousel;
				 	 //建造实例
				 	carousel.render({
				    elem: '#test1'
				    ,width: '1000px' //设置容器宽度
				    ,height: '400px'
				    ,arrow: 'always' //始终显示箭头
				    //,anim: 'updown' //切换动画方式
				  });
				});
				$.ajax({ //
					type : "get",
					url : "${basePath}indexNoticeInit", //添加操作的路径
					dataType : "JSON", //返回JSON格式的数据
					async : false,//同步传输
					success : function(data) {
						if(data==''||data==" "||data==null){
							$("#notice").append("<div><img style='width:1000px; height: 400px' src='${basePath }views/lcx/img/12.jpg' /></div>");
						}else{
							$.each(data,function(){
								$("#notice").append("<div><a class='showImg' href='"+this.url+"'>"+this.title+"</a></div>");
							});
						}
					}
				});
			});
			
			
			$(".activity-subject-contain-middle img").mouseover(function(){
				$(this).attr("class","selected");
			});
			$(".activity-subject-contain-middle img").mouseout(function(){
				$(this).removeAttr("class");
			});
			$(".folk-literature-contain img").mouseover(function(){
				$(this).attr("class","selected");
			});
			$(".folk-literature-contain img").mouseout(function(){
				$(this).removeAttr("class");
			});
		</script>
	</body>
</html>
